package com.softtek.ibeacon.service.config;

import java.io.Serializable;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.LinkedList;
import java.util.List;
import java.util.TreeSet;

 
 

public class ConfigurationsProxyDelegate
	implements ConfigurationsProxyView, Serializable {

    private static final long serialVersionUID = 1L;
    private static final ConfigurationsProxy proxy = ConfigurationsProxy.INSTANCE;

    @Override
    public boolean enableBypassQuickLogin() {
	return proxy.enableBypassQuickLogin();
    }

    @Override
    public String getVersion() {
	return proxy.getVersion();
    }

    @Override
    public String getHostName() {
	try {
	    return InetAddress.getLocalHost().getHostName();
	} catch (UnknownHostException e) {
	    e.printStackTrace();
	}
	return "unknown";
    }

    @Override
    public List<String> getUsedDeployPropertyNames() {
	return new LinkedList<String>(new TreeSet<String>(proxy.getUsedDeployProperties().keySet()));
    }

    @Override
    public String getUsedDeployProperty(String name) {
	return proxy.getUsedDeployProperties().get(name);
    }

    @Override
    public List<String> getAllPropertyNames() {
	return new LinkedList<String>(new TreeSet<String>(proxy.getAllProperties().keySet()));
    }

    @Override
    public String getProperty(String name) {
	return proxy.getAllProperties().get(name);
    }

    @Override
    public String getRevision() {
	return getUsedDeployProperty("svn.revision");
    }

    @Override
    public String getSvnUrl() {
	return getUsedDeployProperty("svn.url");
    }

    @Override
    public void onRemove() {
    }
}
